package org.jeecg.modules.demo.single.service;

import com.alibaba.fastjson.JSONObject;
import org.jeecg.modules.demo.single.entity.ZnzfNeedSingle;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.demo.single.entity.ZnzfNeedSingleVo;

import java.util.List;

/**
 * @Description: 单身宿舍申请
 * @Author: jeecg-boot
 * @Date:   2022-03-29
 * @Version: V1.0
 */
public interface IZnzfNeedSingleService extends IService<ZnzfNeedSingle> {

    JSONObject applyMessage(String projectId, String uid);

//    void insert(ZnzfNeedSingle znzfNeedSingle);

    List<ZnzfNeedSingleVo> listByOrgCode(Integer step);

    int distribute(String eid, String projectId);

    /**
     * 职工单位科室审核	1
     * 管理单位科室审核	2
     * 管理单位领导审核	3
     * 管理单位公寓车间审核	4
     * @param value
     * @return
     */
    String intToRolename(int value);

    /**
     * 职工单位科室审核	1
     * 管理单位科室审核	2
     * 管理单位领导审核	3
     * 管理单位公寓车间审核	4
     * @param rolename
     * @return
     */
    int roleNameToInt(String rolename);

    /**
     * 判断该用户的角色是否包含rolename
     * @param username
     * @param rolename
     * @return
     */
    boolean isInCheckRole(String username,String rolename);

    /**
     * 管理员审核单身公寓申请,要求不是最后一步审核
     *
     * @param step   当前审核的步骤
     * @param id
     * @param uid
     * @param result
     * @param note
     * @return
     */
    int checkApply(int step,String id,String uid,int result,String note);

    /**
     * 管理员审核单身公寓申请,最后一步审核
     *
     * @param step   当前审核的步骤
     * @param id
     * @param uid
     * @param result
     * @param note
     * @return
     */
    int checkApplyLastStep(int step,String id,String uid,int result,String note);

    ZnzfNeedSingle searchByEid(String eid);

    int insert(ZnzfNeedSingle znzfNeedSingle);

    ZnzfNeedSingle searchByEidAndProjectId(String eid, String projectId);
}
